package com.hziee.graduate.ticket.controller;


import com.hziee.graduate.ticket.dto.R;
import com.hziee.graduate.ticket.entity.Type;
import com.hziee.graduate.ticket.service.TypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("type")
public class TypeController {

    @Resource
    TypeService typeService;
    @GetMapping("getAllTypes")
    public R<List<Type>> getAllTypes(){
        List<Type> types = typeService.getBaseMapper().selectList(null);
        return R.success("获取电影类型成功",types);
    }
}

